package com.financing.service.user;
import java.util.Arrays;
import java.util.Map;

import com.financing.model.user.Bank;
import com.financing.service.BaseService;
import com.jfinal.plugin.activerecord.Page;

public class BankService extends BaseService<Bank>{

	/**
	 * 根据Code查找
	 * @return
	 */
	public Bank findByCode(String code) {
		return Bank.me.findFirst("select * from bank where code=?", code);
	}
	
	/**
	 * 分页信息
	 * @param map 
	 * @return 
	 */
	public Page<Bank> list(int page, int size, Map<String, String> map) {
		return Bank.me.paginate(page, size, buildSql("bank",Arrays.asList("create_time"),map));
	}
}
